import java.util.Scanner;

public class Array_08 {


    public static void main(String[] args) {
    int[] arr=new int[5];
    method(arr);
    }



    public static void method(int [] arr){
        Scanner scanner = new Scanner(System.in);
        int sum =0;
        for (int i=0;i<arr.length;i++){
            System.out.println("请输入第"+(i+1)+"评委的打分");
            arr[i]=scanner.nextInt();
        }

        for (int i=0;i<arr.length-1;i++)
            for (int j=0;j<arr.length-1;j++)
            {
                int temp;
                if (arr[j] >arr[j+1])
                {
                    temp=arr[j];
                    arr[j]=arr[j+1];
                    arr[j+1]=temp;
                }
            }

        printArray(arr);
        for (int i=1;i<arr.length-1;i++)
        {
            sum=sum+arr[i];
        }

        System.out.println(sum);




    }








    public  static void printArray(int[] arr){
        System.out.print("[");
        for (int i=0;i<arr.length;i++){
            if (i==arr.length-1){
                System.out.print(arr[i]);
            }
            else
            {
                System.out.print(arr[i]+",");
            }
        }
        System.out.println("]");
    }
}
